/*
 * @Description: Test类
 * @Author: rendc
 * @Date: 2024-08-28 14:37:00
 * @LastEditors: HKH
 * @LastEditTime: 2024-09-05 08:58:30
 */
public class Test{
    // main方法
    public static void main(String[] args){
      // 输出hello
      System.out.println("hello");
      // 声明一个 int 类型的变量
      int a;
      // 初始化a
      a = 15;
      // a = 15.1; // 报错
      // 输出a的值到控制台
      System.out.println("a=" + a);// 15
      int b = 10;
      System.out.println("b=" + b);// 10
      int c = b;
      b = 100;
      System.out.println("b=" + b);// 100
      System.out.println("c=" + c);// 10 or 100
      // 字符类型
      char c1 = 'a';
      char c2 = 'B';
      char c3 = '你';
      char c4 = '好';
      // char c5 = '';
      // char c6 = 'abc';
      System.out.println("c1:" + c1);
      System.out.println("c2:" + c2);
      System.out.println("c3:" + c3);
      System.out.println("c4:" + c4);
      // System.out.println("c5:" + c5); // 编译错误
      // System.out.println("c6:" + c6); // 编译错误
      // int字面值量可以赋值给char变量
      char c7 = 48;
      System.out.println("c7:" + c7); // 0
      char c8 = 65;
      System.out.println("c8:" + c8); //A
      // 转义字符 \
      String s1 = "Hello, \"world\"!";
      System.out.println("s1:" + s1); 
      String s2 = "Hello, \\world\\!";
      System.out.println("s2:" + s2); 
      String s3 = "Hello, \n world!";
      System.out.println("s3:" + s3); 
    }
  }